package com.zmx.product.repository;

import com.zmx.common.common.repository.BaseRepository;
import com.zmx.product.entity.ProductCategory;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author zhaomxr
 */
public interface ProductCategoryRepository extends BaseRepository<ProductCategory> {

    @Query(value = "SELECT * FROM product_category WHERE is_vaild = 1 ORDER BY ranking DESC limit 4", nativeQuery = true)
    List<ProductCategory> getCategoryOnly4();
}
